/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="storage_order")
public class StorageOrder implements Serializable {
	public StorageOrder() {
	}
	
	private int id;
	
	private cn.imvc.app.entities.Member member;
	
	private String code;
	
	private cn.imvc.app.entities.Orders order;
	
	private String orderCode;
	
	private cn.imvc.app.entities.Seller seller;
	
	private cn.imvc.app.entities.Storage storage;
	
	private cn.imvc.app.entities.Express express;
	
	private String expressCode;
	
	private Integer goodsAmount;
	
	private Integer discountAmount;
	
	private Integer resultAmount;
	
	private Integer refundAmount;
	
	private Byte state;
	
	private java.util.Date deliveryTime;
	
	private java.util.Date receiptTime;
	
	private java.util.Date receiptEndTime;
	
	private java.util.Date refundTime;
	
	private java.util.Date finishTime;
	
	private Byte isDelayed;
	
	private Integer weight;
	
	private Integer freight;
	
	private Integer overweightFreight;
	
	private String remark;
	
	private java.util.Date createdAt;
	
	private java.util.Date updatedAt;
	
	private java.util.Set goodsOrder = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_STORAGEORDER_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_STORAGEORDER_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 二级订单编号
	 */
	public void setCode(String value) {
		this.code = value;
	}
	
	/**
	 * 二级订单编号
	 */
	@Column(name="code", nullable=true, length=255)	
	public String getCode() {
		return code;
	}
	
	/**
	 * 一级订单编号
	 */
	public void setOrderCode(String value) {
		this.orderCode = value;
	}
	
	/**
	 * 一级订单编号
	 */
	@Column(name="orderCode", nullable=true, length=255)	
	public String getOrderCode() {
		return orderCode;
	}
	
	/**
	 * 快递单号
	 */
	public void setExpressCode(String value) {
		this.expressCode = value;
	}
	
	/**
	 * 快递单号
	 */
	@Column(name="expressCode", nullable=true, length=255)	
	public String getExpressCode() {
		return expressCode;
	}
	
	/**
	 * 商品总价格
	 */
	public void setGoodsAmount(int value) {
		setGoodsAmount(new Integer(value));
	}
	
	/**
	 * 商品总价格
	 */
	public void setGoodsAmount(Integer value) {
		this.goodsAmount = value;
	}
	
	/**
	 * 商品总价格
	 */
	@Column(name="goodsAmount", nullable=true, length=10)	
	public Integer getGoodsAmount() {
		return goodsAmount;
	}
	
	/**
	 * 优惠金额
	 */
	public void setDiscountAmount(int value) {
		setDiscountAmount(new Integer(value));
	}
	
	/**
	 * 优惠金额
	 */
	public void setDiscountAmount(Integer value) {
		this.discountAmount = value;
	}
	
	/**
	 * 优惠金额
	 */
	@Column(name="discountAmount", nullable=true, length=10)	
	public Integer getDiscountAmount() {
		return discountAmount;
	}
	
	/**
	 * 应付价格
	 */
	public void setResultAmount(int value) {
		setResultAmount(new Integer(value));
	}
	
	/**
	 * 应付价格
	 */
	public void setResultAmount(Integer value) {
		this.resultAmount = value;
	}
	
	/**
	 * 应付价格
	 */
	@Column(name="resultAmount", nullable=true, length=10)	
	public Integer getResultAmount() {
		return resultAmount;
	}
	
	/**
	 * 退款金额
	 */
	public void setRefundAmount(int value) {
		setRefundAmount(new Integer(value));
	}
	
	/**
	 * 退款金额
	 */
	public void setRefundAmount(Integer value) {
		this.refundAmount = value;
	}
	
	/**
	 * 退款金额
	 */
	@Column(name="refundAmount", nullable=true, length=10)	
	public Integer getRefundAmount() {
		return refundAmount;
	}
	
	/**
	 * 订单状态 ：10创建订单、11用户取消订单、12系统取消订单、13管理员驳回订单、20付款中、21付款成功、22付款失败、30待发货、31已发货、32发货失败、40确认收货、41系统确认收货、50退货申请、51审核通过、52审核失败、53退货成功 54退货失败、60订单完成
	 */
	public void setState(byte value) {
		setState(new Byte(value));
	}
	
	/**
	 * 订单状态 ：10创建订单、11用户取消订单、12系统取消订单、13管理员驳回订单、20付款中、21付款成功、22付款失败、30待发货、31已发货、32发货失败、40确认收货、41系统确认收货、50退货申请、51审核通过、52审核失败、53退货成功 54退货失败、60订单完成
	 */
	public void setState(Byte value) {
		this.state = value;
	}
	
	/**
	 * 订单状态 ：10创建订单、11用户取消订单、12系统取消订单、13管理员驳回订单、20付款中、21付款成功、22付款失败、30待发货、31已发货、32发货失败、40确认收货、41系统确认收货、50退货申请、51审核通过、52审核失败、53退货成功 54退货失败、60订单完成
	 */
	@Column(name="state", nullable=true)	
	public Byte getState() {
		return state;
	}
	
	/**
	 * 发货时间
	 */
	public void setDeliveryTime(java.util.Date value) {
		this.deliveryTime = value;
	}
	
	/**
	 * 发货时间
	 */
	@Column(name="deliveryTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getDeliveryTime() {
		return deliveryTime;
	}
	
	/**
	 * 确认收货时间
	 */
	public void setReceiptTime(java.util.Date value) {
		this.receiptTime = value;
	}
	
	/**
	 * 确认收货时间
	 */
	@Column(name="receiptTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getReceiptTime() {
		return receiptTime;
	}
	
	/**
	 * 截至收货时间
	 */
	public void setReceiptEndTime(java.util.Date value) {
		this.receiptEndTime = value;
	}
	
	/**
	 * 截至收货时间
	 */
	@Column(name="receiptEndTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getReceiptEndTime() {
		return receiptEndTime;
	}
	
	/**
	 * 退款时间
	 */
	public void setRefundTime(java.util.Date value) {
		this.refundTime = value;
	}
	
	/**
	 * 退款时间
	 */
	@Column(name="refundTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getRefundTime() {
		return refundTime;
	}
	
	/**
	 * 完成时间
	 */
	public void setFinishTime(java.util.Date value) {
		this.finishTime = value;
	}
	
	/**
	 * 完成时间
	 */
	@Column(name="finishTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getFinishTime() {
		return finishTime;
	}
	
	/**
	 * 是否延期收货
	 */
	public void setIsDelayed(byte value) {
		setIsDelayed(new Byte(value));
	}
	
	/**
	 * 是否延期收货
	 */
	public void setIsDelayed(Byte value) {
		this.isDelayed = value;
	}
	
	/**
	 * 是否延期收货
	 */
	@Column(name="isDelayed", nullable=true)	
	public Byte getIsDelayed() {
		return isDelayed;
	}
	
	/**
	 * 重量 克
	 */
	public void setWeight(int value) {
		setWeight(new Integer(value));
	}
	
	/**
	 * 重量 克
	 */
	public void setWeight(Integer value) {
		this.weight = value;
	}
	
	/**
	 * 重量 克
	 */
	@Column(name="weight", nullable=true, length=10)	
	public Integer getWeight() {
		return weight;
	}
	
	/**
	 * 运费
	 */
	public void setFreight(int value) {
		setFreight(new Integer(value));
	}
	
	/**
	 * 运费
	 */
	public void setFreight(Integer value) {
		this.freight = value;
	}
	
	/**
	 * 运费
	 */
	@Column(name="freight", nullable=true, length=10)	
	public Integer getFreight() {
		return freight;
	}
	
	/**
	 * 超重运费
	 */
	public void setOverweightFreight(int value) {
		setOverweightFreight(new Integer(value));
	}
	
	/**
	 * 超重运费
	 */
	public void setOverweightFreight(Integer value) {
		this.overweightFreight = value;
	}
	
	/**
	 * 超重运费
	 */
	@Column(name="overweightFreight", nullable=true, length=10)	
	public Integer getOverweightFreight() {
		return overweightFreight;
	}
	
	/**
	 * 买家留言
	 */
	public void setRemark(String value) {
		this.remark = value;
	}
	
	/**
	 * 买家留言
	 */
	@Column(name="remark", nullable=true, length=255)	
	public String getRemark() {
		return remark;
	}
	
	/**
	 * 创建时间
	 */
	public void setCreatedAt(java.util.Date value) {
		this.createdAt = value;
	}
	
	/**
	 * 创建时间
	 */
	@Column(name="createdAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getCreatedAt() {
		return createdAt;
	}
	
	/**
	 * 更新时间
	 */
	public void setUpdatedAt(java.util.Date value) {
		this.updatedAt = value;
	}
	
	/**
	 * 更新时间
	 */
	@Column(name="updatedAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getUpdatedAt() {
		return updatedAt;
	}
	
	public void setMember(cn.imvc.app.entities.Member value) {
		this.member = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Member.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="memberId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Member getMember() {
		return member;
	}
	
	public void setOrder(cn.imvc.app.entities.Orders value) {
		this.order = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Orders.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="orderId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Orders getOrder() {
		return order;
	}
	
	public void setSeller(cn.imvc.app.entities.Seller value) {
		this.seller = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Seller.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="sellerId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Seller getSeller() {
		return seller;
	}
	
	public void setStorage(cn.imvc.app.entities.Storage value) {
		this.storage = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Storage.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="storageId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Storage getStorage() {
		return storage;
	}
	
	public void setExpress(cn.imvc.app.entities.Express value) {
		this.express = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Express.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="expressId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Express getExpress() {
		return express;
	}
	
	public void setGoodsOrder(java.util.Set value) {
		this.goodsOrder = value;
	}
	
	@OneToMany(mappedBy="orderStorage", targetEntity=cn.imvc.app.entities.GoodsOrder.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getGoodsOrder() {
		return goodsOrder;
	}
	
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("StorageOrder[ ");
			sb.append("Id=").append(getId()).append(" ");
			if (getMember() != null)
				sb.append("Member.Persist_ID=").append(getMember().toString(true)).append(" ");
			else
				sb.append("Member=null ");
			sb.append("Code=").append(getCode()).append(" ");
			if (getOrder() != null)
				sb.append("Order.Persist_ID=").append(getOrder().toString(true)).append(" ");
			else
				sb.append("Order=null ");
			sb.append("OrderCode=").append(getOrderCode()).append(" ");
			if (getSeller() != null)
				sb.append("Seller.Persist_ID=").append(getSeller().toString(true)).append(" ");
			else
				sb.append("Seller=null ");
			if (getStorage() != null)
				sb.append("Storage.Persist_ID=").append(getStorage().toString(true)).append(" ");
			else
				sb.append("Storage=null ");
			if (getExpress() != null)
				sb.append("Express.Persist_ID=").append(getExpress().toString(true)).append(" ");
			else
				sb.append("Express=null ");
			sb.append("ExpressCode=").append(getExpressCode()).append(" ");
			sb.append("GoodsAmount=").append(getGoodsAmount()).append(" ");
			sb.append("DiscountAmount=").append(getDiscountAmount()).append(" ");
			sb.append("ResultAmount=").append(getResultAmount()).append(" ");
			sb.append("RefundAmount=").append(getRefundAmount()).append(" ");
			sb.append("State=").append(getState()).append(" ");
			sb.append("DeliveryTime=").append(getDeliveryTime()).append(" ");
			sb.append("ReceiptTime=").append(getReceiptTime()).append(" ");
			sb.append("ReceiptEndTime=").append(getReceiptEndTime()).append(" ");
			sb.append("RefundTime=").append(getRefundTime()).append(" ");
			sb.append("FinishTime=").append(getFinishTime()).append(" ");
			sb.append("IsDelayed=").append(getIsDelayed()).append(" ");
			sb.append("Weight=").append(getWeight()).append(" ");
			sb.append("Freight=").append(getFreight()).append(" ");
			sb.append("OverweightFreight=").append(getOverweightFreight()).append(" ");
			sb.append("Remark=").append(getRemark()).append(" ");
			sb.append("CreatedAt=").append(getCreatedAt()).append(" ");
			sb.append("UpdatedAt=").append(getUpdatedAt()).append(" ");
			sb.append("GoodsOrder.size=").append(getGoodsOrder().size()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
